package com.jinsi.service.tang.iml;

import com.jinsi.mapper.tang.SensitiveCharacterMapper;
import com.jinsi.pojo.SensitiveCharacter;
import com.jinsi.service.tang.SensitiveCharacterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

/**
 * 过滤敏感词
 * @author 唐文博
 * @Date 2022-10-14
 */
@Service
@Transactional
public class SensitiveCharacterServiceImpl implements SensitiveCharacterService {
    @Autowired
    private SensitiveCharacterMapper sensitiveCharacterMapper;

    @Override
    public List<String> getSensitiveCharacter() {
        List<String> list = new ArrayList();
        List<SensitiveCharacter> sensitiveCharacter = sensitiveCharacterMapper.getSensitiveCharacter();
        for (SensitiveCharacter s : sensitiveCharacter) {
            list.add(s.getWordsName());
        }
        return list;
    }
}
